package com.jcooky.tutorfs.proxy.protocol;

import org.apache.mina.core.buffer.IoBuffer;

public class ResOk extends AbstractMessage {

	private boolean ok;
	public void fromBytes(IoBuffer buf) {
		byte isok = buf.get();
		this.ok = isok == 1;
	}

	public void toBytes(IoBuffer buf) {
		buf.put(ok == true ? (byte)1 : (byte)0);
	}

	public int length() {
		return 1;
	}

	public void setOk(boolean ok) {
		this.ok = ok;
	}

	public boolean isOk() {
		return ok;
	}
	
}
